package com.grom.action;

import com.dispacher.context.ContextHolder;
import com.grom.dao.DatabaseDao;
import com.holder.DBContextHolder;
import com.holder.DBUTil;

public class DatabaseAction {
	public void gotoPage() {
		ContextHolder.forward("/WEB-INF/jsp/database.jsp");
	}

	public void doExecute() {
		String sql = ContextHolder.findInstance().getRequest()
				.getParameter("sql");
		DBContextHolder.setContextConnection(DatabaseDao.getConnection());
		DBUTil.update(sql);
		ContextHolder.forward("/WEB-INF/jsp/database.jsp");
	}
}
